package com.qishuihe.basedomain.infrastructure.mq;

import com.alibaba.fastjson2.JSONObject;
import com.qishuihe.basedomain.infrastructure.constant.BaseDomainConstant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class ProductMessageHandler {


    @Autowired
    private KafkaTemplate kafkaTemplate;

    public void sendLog(Object data){
        log.info("生产消息:"+ JSONObject.toJSONString(data));
        kafkaTemplate.send(BaseDomainConstant.QISHUIHE_LOG, JSONObject.toJSONString(data));
    }
}